package com.cmc.cloud.cmclink.doc.controller.admin.multimodaltransport;

import java.util.List;

import javax.annotation.Resource;
import javax.validation.Valid;

import com.cmes.framework.operatelog.core.annotations.OperateLog;import com.cmes.framework.operatelog.core.enums.OperateTypeEnum;import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import com.cmc.cloud.cmclink.doc.service.multimodaltransport.ShowExportFreightMultiService;
import com.cmc.cloud.cmclink.doc.service.si.ConfirmNoticeService;
import com.cmc.cloud.cmclink.doc.vo.confirmnoticevo.ConfirmNoticeDetailRespVO;
import com.cmc.cloud.cmclink.doc.vo.multimodaltransport.showexportfreight.ShowExportFreightPageReqVO;
import com.cmc.cloud.cmclink.doc.vo.multimodaltransport.showexportfreight.ShowExportFreightRespVO;
import com.cmes.framework.biz.advice.annotations.UseResponsePropertyAdvice;
import com.cmes.framework.common.pojo.CommonResult;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;

/**
 * 查看费用表变更前端接口Controller
 * 
 * @author codegen
 */
@Tag(name = "管理后台 - 多式联运-查看费用表变更")
@RestController
@Validated
@RequestMapping("/doc/v1/show-export-change-multi")
public class ShowExportFreightChangeMultiController {

    @Resource
    private ConfirmNoticeService confirmNoticeService;

    @Resource
    private ShowExportFreightMultiService showExportFreightMultiService;

     @OperateLog(type = OperateTypeEnum.GET)
    @Operation(summary = "查看费用表变更详情")
    @GetMapping("/get/{id}")
    @Parameter(name = "id", description = "编号", required = true, example = "1024")
    public CommonResult<ConfirmNoticeDetailRespVO> getConfirmNoticeMulti(@PathVariable("id") Long id) {
        ConfirmNoticeDetailRespVO resp = confirmNoticeService.getConfirmNotice(id);
        return CommonResult.success(resp);
    }

    @OperateLog(type = OperateTypeEnum.GET)
    @Operation(summary = "查看费用表变更分页")
    @PostMapping("/all")
    @UseResponsePropertyAdvice
    @PreAuthorize("@ss.hasPermission('doc:showExportFreight:search')")
    public CommonResult<List<ShowExportFreightRespVO>>
        getConfirmNoticeMultiPage(@Valid @RequestBody ShowExportFreightPageReqVO pageVO) {
        List<ShowExportFreightRespVO> resultList = showExportFreightMultiService.getConfirmNoticeMulti(pageVO);
        return CommonResult.success(resultList);
    }
}
